package com.black.common.core.domain.resp;

import com.black.common.core.domain.entity.SysDept;
import com.black.common.core.domain.entity.SysRole;
import com.black.common.core.domain.entity.SysUser;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;

/**
 * 自定义对象
 *
 * @author L
 */
@Getter
@Setter
public class AdminUserResp {

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户账号
     */
    private String userName;

    /**
     * 用户密码
     */
    private String password;

    /**
     * 用户昵称
     */
    private String nickName;

    /**
     * 用户邮箱
     */
    private String email;

    /**
     * 手机号码
     */
    private String phonenumber;

    /**
     * 用户性别
     */
    private String sex;

    /**
     * 用户头像
     */
    private String avatar;

    /**
     * 最后登录IP
     */
    private String loginIp;

    /**
     * 最后登录地点
     */
    private String loginLocation;

    /**
     * 最后登录时间
     */
    private Date loginDate;

    /**
     * 角色列表
     */
    private List<SysRole> roles;

    /**
     * 所在部门
     */
    private SysDept dept;

    public AdminUserResp(SysUser user, List<SysRole> roles, SysDept dept) {
        this.userId = user.getUserId();
        this.userName = user.getUserName();
        this.nickName = user.getNickName();
        this.password = user.getPassword();
        this.email = user.getEmail();
        this.phonenumber = user.getPhonenumber();
        this.sex = user.getSex();
        this.avatar = user.getAvatar();
        this.loginIp = user.getLoginIp();
        this.roles = roles;
        this.dept = dept;
    }

    /**
     *
     */
    public AdminUserResp() {
    }

}
